import Ionicons from 'react-native-vector-icons/icomoon';

export const initIcons = () => {

  const icons = {
    'market_n': [22],
    'market_h': [22],
    'zc_n': [22],
    'zc_h': [22],
    'my_n': [22],
    'my_h': [22],
  };

  return new Promise((resolve) => {

    Promise
      .all(Object.keys(icons).map(
        iconName => Ionicons.getImageSource(
          iconName, 20)))
      .then((sources) => {
        let iconsMap = {};
        Object.keys(icons).forEach(
          (iconName, idx) => { iconsMap[iconName] = sources[idx] });
        resolve(iconsMap);
      });
  });

};